import {get, post} from "@/utils/requests/requests"
import {getLoginUrl} from "@/network/serverUrl/getServerUrl";


/**
 * 统一登录接口
 * */
export const login = loginData => post({
    url: getLoginUrl(),
    noJson: 1,
    params: {
        account: loginData.phoneNumber,
        password: loginData.password
    }
})

/**
 * 管理员登录
 * */
export function loginAdmin(loginData) {
    return post({
        url: '/admin/loginByPassword',
        noJson: 1,
        params: {
            account: loginData.phoneNumber,
            password: loginData.password
        }
    })
}

/**
 * 经销商登录
 * */
export function loginCoop(loginData) {
    return post({
        url: '/coop/loginByPassword',
        noJson: 1,
        params: {
            account: loginData.phoneNumber,
            password: loginData.password
        }
    })
}
